home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
fpkpas92.zip
/
SRCRTL.ZIP
/
RTL
/
DOS
/
COLORS.PPI
< prev
next >
Wrap
Text File
|
1997-07-01
|
2KB
|
92 lines
{ COLORS.PPI }
{ GetBkColor , SetBkColor , GetColor , SetColor , GetMaxColor }
function Convert(Color:longint):longint;
var c,r,g,b:longint;
begin
if BytesPerPixel = 1 then
begin
if (Color and $FF000000)=0 then
begin
C:=Color and $FF;
Convert:=(C shl 24) + (C shl 16) + (C shl 8) + C;
end else
begin
SetRGBPalette(((Color and $FF000000) shr 24),
((Color and $00FF0000) shr 16),
((Color and $0000FF00) shr 8),
(Color and $000000FF));
C:=(Color and $FF000000);
Convert:=(C shr 24) + (C shr 16) + (C shr 8) + C;
end;
end else
begin
R:=(Color and $00FF0000) shr (24-VESAInfo.rm_size);
G:=(Color and $0000FF00) shr (16-VESAInfo.gm_size);
B:=(Color and $000000FF) shr (8-VESAInfo.bm_size);
C:=(R shl VESAInfo.rf_pos) or (G shl VESAInfo.gf_pos) or
(B shl VESAInfo.bf_pos);
Convert:=(C shl 16) or C;
end;
end;
function GetColor : longint;
begin
_graphresult:=grOk;
if not isgraphmode then
begin
_graphresult:=grNoInitGraph;
exit;
end;
getcolor:=aktcolor;
end;
{ ----------------------------------------------------------------------- }
procedure SetColor(color : Longint);
begin
_graphresult:=grOk;
if not isgraphmode then
begin
_graphresult:=grNoInitGraph;
exit;
end;
aktcolor:=convert(Color);
end;
{ ----------------------------------------------------------------------- }
function GetBkColor : longint;
begin
_graphresult:=grOk;
if not isgraphmode then
begin
_graphresult:=grNoInitGraph;
exit;
end;
getbkcolor:=aktbackcolor;
end;
procedure SetBkColor(Color : longint);
begin
_graphresult:=grOk;
if not isgraphmode then
begin
_graphresult:=grNoInitGraph;
exit;
end;
aktbackcolor:=convert(Color);
end;
function GetMaxColor : longint;
begin
_graphresult:=grOk;
if not isgraphmode then
begin
_graphresult:=grNoInitGraph;;
exit;
end;
getmaxcolor:=(1 shl VESAInfo.BitsPerPixel)-1;
end;